﻿using GameFramework.DataTable;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


namespace MYSTARFORCE
{
    /// <summary>
    /// 读取武器表
    /// </summary>
    public class DRWeapon : IDataRow
    {
        /// <summary>
        /// 获取武器编号
        /// </summary>
        public int Id
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取攻击力
        /// </summary>
        public int Attack
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取攻击间隔
        /// </summary>
        public float AttackInterval
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取子弹编号
        /// </summary>
        public int BulletId
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取子弹速度
        /// </summary>
        public float BulletSpeed
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取子弹音效ID
        /// </summary>
        public int BulletSoundId
        {
            get;
            private set;
        }


        public void ParseDataRow(string dataRowText)
        {
            string[] text = DataTableExtension.SplitDataRow(dataRowText);
            int index = 0;
            index++;
            Id = int.Parse(text[index++]);
            index++;
            Attack = int.Parse(text[index++]);
            AttackInterval = float.Parse(text[index++]);
            BulletId = int.Parse(text[index++]);
            BulletSpeed = float.Parse(text[index++]);
            BulletSoundId = int.Parse(text[index++]);
        }
        
    }
}